home *** CD-ROM | disk | FTP | other *** search
Text File | 1993-12-17 | 8.8 KB | 234 lines | [TEXT/MPS ] |
- #
- # ****************************************************************************
- #
- # File Name: Word5.vu
- #
- # Contains: Quick look test script for Word version 5.0
- #
- # Written by: Kevin Avoy, Ken Landreth, Michael Leong, Gil Spencer et al
- #
- # Copyright: © 1993 by Apple Computer, Inc., all rights reserved.
- #
- # ****************************************************************************
- # C h a n g e H i s t o r y (most recent first):
- # ****************************************************************************
- #
- # Vers Date Author Description
- # ---- -------- ------ ---------------------------------------------
- # <1.0.8> 12/14/93 KTA Added wait after selecting the print preview menu to allow
- # dialog to appear.
- # <1.0.7> 9/30/93 KTA Initialize gFileName prior to gApptitle being updated by
- # launchTwitch().
- # <1.0.6> 9/23/93 KTA The WordProcessor.Lib was not defined as a dependancy.
- # <1.0.5> 9/22/93 KTA Changed gDismissSFPut to gSaveAsHook3
- # <1.0.2> 6/16/93 NAGA Renaming InitGlobals(ScriptLevel)to InitGlobals(ScriptLevel)
- # <1+> 5/25/93 NAGA Adding header and porting old files to follow new standards
- #
- # ****************************************************************************
- #
-
-
-
- ########################################################################
- # External libraries
- #=======================================================================
- Libraries "Output.Lib", "DoTasks.Lib","Draw.Lib","UserInterface.Lib", "Font.Lib", "Globals.Lib", "LaunchQuit.Lib", "TCS.Lib", "WordProcessor.Lib";
-
-
- #########################################################################
- ######## Application Specific Tasks
- #########################################################################
-
-
- #########################################################################
- # InitAppGlobals()
- #========================================================================
- # Author: ML
- # Description: Sets up the app's globals.
- # Parameters: None
- # Returns: Nothing
- # Application: Word
- # Examples: InitAppGlobals()
- #========================================================================
- # History:
- #
- ########################################################################
- task InitAppGlobals()
- begin
-
- logstr("setting up {global gApptitle}'s globals");
- global kClick, kDrag, kMultiDrag, kMultiClickDrag, kMultiClick;
- global kPalDocWind, kPalWind, kPullOffPal, kPopUpPal, kScrollPal;
- # global kTabPaletteNum := 1;
- # global kAlignPaletteNum := 2;
- # global kSpacingPaletteNum := 3;
- # global kParSpacePaletteNum := 4;
-
- # global gPaletteList := {
- # { #### Start Palette #1 - Tabs
- # {121, 48, 217, 57,0}, # Location of tab palette relative to the window
- # kPalDocWind, # Palette type
- # {5,1}, # Size of Tool matrix {numElemsWide,numElemsTall}
- # {19,8}, # Offset between tools {h,v}
- # 0, # Not used at this time
- # 0 # Not used at this time
- # }, #### End Palette #1
- # { #### Start Palette #2 - Alignment
- # {231, 48, 307, 57,0}, # Location of alignment palette relative to the window
- # kPalDocWind, # Palette type
- # {4,1}, # Size of Tool matrix {numElemsWide,numElemsTall}
- # {19,8}, # Offset between tools {h,v}
- # 0, # Not used at this time
- # 0 # Not used at this time
- # }, #### End Palette #2
- # { #### Start Palette #3 - Line spacing
- # {321, 48, 377, 57,0}, # Location of Line spacing palette relative to the window
- # kPalDocWind, # Palette type
- # {3,1}, # Size of Tool matrix {numElemsWide,numElemsTall}
- # {19,8}, # Offset between tools {h,v}
- # 0, # Not used at this time
- # 0 # Not used at this time
- # }, #### End Palette #3
- # { #### Start Palette #4 - Paragraph spacing
- # {391, 48, 427, 57,0}, # Location of Line Paragraph spacing palette relative to the window
- # kPalDocWind, # Palette type
- # {2,1}, # Size of Tool matrix {numElemsWide,numElemsTall}
- # {19,8}, # Offset between tools {h,v}
- # 0, # Not used at this time
- # 0 # Not used at this time
- # } # End Palette #4
- # };
- #
- # ### Word {Flag, Pattern, Line, Color}
- # ### Palette Elements:= Tool#, Pal#, ToolName, ToolType, DblClktoEnd SetAttributes
- # global TabLeftTool := { 1, 1, "Tab Left", kClick, 0, {0} };
- # global TabCenterTool := { 2, 1, "Tab Center", kClick, 0, {0} };
- # global TabRightTool := { 3, 1, "Tab Right", kClick, 0, {0} };
- # global TabDecimalTool := { 4, 1, "Tab Decimal", kClick, 0, {0} };
- # global TabVerticalTool := { 5, 1, "Tab Vertical", kClick, 0, {0} };
- # global AlignLeftTool := { 1, 2, "Align Left", 0, 0, {0} };
- # global AlignCenterTool := { 2, 2, "Align Center", 0, 0, {0} };
- # global AlignRightTool := { 3, 2, "Align Right", 0, 0, {0} };
- # global AlignLRTool := { 4, 2, "Align LR", 0, 0, {0} };
- # global SingleSpaceTool := { 1, 3, "Single Space", 0, 0, {0} };
- # global xSpaceTool := { 2, 3, "1-1/2 Space", 0, 0, {0} };
- # global DoubleSpaceTool := { 3, 3, "Double Space", 0, 0, {0} };
- # global NoParSpaceTool := { 1, 4, "No Par Space", 0, 0, {0} };
- # global ParSpaceTool := { 2, 4, "Par Space", 0, 0, {0} };
- #
- # # global Tool list
- #
- # global RulerRect:= {17,32,20,43};
- # global gWindowInset := {0,0,0,0};
- #
- # global TabToolList:={ TabLeftTool,
- # TabCenterTool,
- # TabRightTool,
- # TabDecimalTool,
- # TabVerticalTool
- # };
- #
- # global OtherToolList:={ AlignLeftTool,
- # AlignCenterTool,
- # AlignRightTool,
- # AlignLRTool,
- # SingleSpaceTool,
- # xSpaceTool,
- # DoubleSpaceTool,
- # NoParSpaceTool,
- # ParSpaceTool
- # };
-
- # The above is the tool setup for Word 4.0. It needs to be revised for 5.0.
-
- global RulerMenuPath := {'Ruler','View'};
-
- ### font characteristic lists
- global gFontSizeList := {'9','10','12','14','18', '24'};
- global gFontStyleList := {'Bold','Italic','Underline'};
-
- ### Name of the Plain (style) menu item ####
- global gPlainStyle := "Plain Text"; # Plain-Style menu item
-
- ### How to get to the next line
- global gNextLineMethod := 4;
- ### 1 - ReturnKey, 2 - EnterKey, 3 - DownArrow Key, 4 - TabKey, {} - Move/Click, {'Untitled'} - Move relative to the window titled 'Untitled' /Click
-
- ### Does moving to the next line clear all font info
- global gNextLineClearsFontSettings := 0;
-
- end; #InitAppGlobals
-
- #########################################################################
- # Views()
- #========================================================================
- # Author: ML
- # Description: Change Views.
- # Parameters: None
- # Returns: Nada
- # Application: Word
- # Examples: Views();
- #========================================================================
- # History:
- #
- ########################################################################
- task Views()
- begin
- LogStr( " Changing Views ");
- SelectMenuItem("Print Preview", "File");
- wait(3);
- selectButton('Page Layout');
- Println;
- end;
-
- #########################################################################
- # WordSummaryHandler()
- #========================================================================
- # Author: ML
- # Description: Handle the Word summary window.
- # Parameters: None
- # Returns: Nada
- # Application: Word
- # Examples: WordSummaryHandler();
- #========================================================================
- # History:
- #
- ########################################################################
- task WordSummaryHandler()
- begin
- if match [window t:'Summary Info' o:1]! # if summary window is frontmost
- SpecialKey(ReturnKey, 'Return Key');# dismiss it
- end;
-
- ################################################################################
- #################### Main script ####################
- ################################################################################
- script Word (ScriptLevel:= -1)
- begin
- InitGlobals(ScriptLevel);
- InitDraw();
- InitFonts();
- global gAppTitle := 'Microsoft Word';
- global gAppVersion := '5.1';
- global gFileName := "@!@-{gBuildVers}-{gAppTitle}"; # This is used in SaveAs when saving files
- SuiteStart('Word5.vu'); # begin a new test suite
- if LaunchTwitch("{gAppTitle}",gAliasDirectory) # launch or twitch to your app
- begin
- global gSaveAsHook3 := task WordSummaryHandler;
- InitAppGlobals();
- (*
- *)
- DoSetUpApp(,,,,1,1);
- DoText();
- if (gAppTestLevel = 2)
- DoWPTools(); # ruler tools need to be set up for 5.0
- DoWindow();
- Views();
- DoCloseApp(,'Cancel');
- end; # if LaunchTwitch("{gAppTitle}",gAliasDirectory)
- SuiteEnd();
- end;
-
- ### What's Needed
- # 1) Set up Ruler tools for 5.0
- # 2) insure we've got full menus